import Vue from 'vue'
import VueRouter from 'vue-router'
import home from '../views/home/home.vue'
Vue.use(VueRouter)

const routes = [
  {
    name: 'login',
    path: '/login',
    component: () => import('@/views/user/login.vue')
  },
  {
    name: 'layout',
    path: '/',
    component: () => import('@/views/layout.vue'),
    children: [
      {
        name: 'home',
        path: 'home',
        component: home,
      },
      {
        name: 'movie',
        path: 'movie',
        component: () => import('@/views/movie/movie.vue')
      },
      {
        name: 'QA',
        path: 'QA',
        component: () => import('@/views/QA/QA.vue')
      },
      {
        name: 'user',
        path: 'user',
        component: () => import('@/views/user/user.vue')
      },
      {
        path: '/',
        redirect:'/home'
      }
    ]
  },
  {
    name: 'notfound',
    path: '/notfound',
    component: () => import('@/views/notfound/notfound.vue'),
  },
  {
    path: '*',
    redirect:'/notfound'
  }
]

const router = new VueRouter({
  routes
})

export default router
